package org.example.inventory.controller;

import lombok.RequiredArgsConstructor;
import org.example.inventory.service.InventoryService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("inventory")
@RestController
@RequiredArgsConstructor
public class InventoryController {
    private final InventoryService inventoryService;

    @PutMapping("lock-inventory")
    public ResponseEntity<Void> lockInventory(String skuId, Integer quantity) {
        inventoryService.lockInventory(skuId, quantity);
        return ResponseEntity.noContent().build();
    }
}
